Optimal. Leaf size=53 \[ \frac{\sqrt{a^2+b^2} \tanh ^{-1}\left (\frac{\sin (x) (b-a \cot (x))}{\sqrt{a^2+b^2}}\right )}{b^2}+\frac{a \tanh ^{-1}(\cos (x))}{b^2}-\frac{\csc (x)}{b} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0848644, antiderivative size = 53, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.385, Rules used = {3510, 3486, 3770, 3509, 206} \[ \frac{\sqrt{a^2+b^2} \tanh ^{-1}\left (\frac{\sin (x) (b-a \cot (x))}{\sqrt{a^2+b^2}}\right )}{b^2}+\frac{a \tanh ^{-1}(\cos (x))}{b^2}-\frac{\csc (x)}{b} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3510
Rule 3486
Rule 3770
Rule 3509
Rule 206
Rubi steps
\begin{align*} \int \frac{\csc ^3(x)}{a+b \cot (x)} \, dx &=-\frac{\int (a-b \cot (x)) \csc (x) \, dx}{b^2}+\frac{\left (a^2+b^2\right ) \int \frac{\csc (x)}{a+b \cot (x)} \, dx}{b^2}\\ &=-\frac{\csc (x)}{b}-\frac{a \int \csc (x) \, dx}{b^2}-\frac{\left (a^2+b^2\right ) \operatorname{Subst}\left (\int \frac{1}{a^2+b^2-x^2} \, dx,x,(-b+a \cot (x)) \sin (x)\right )}{b^2}\\ &=\frac{a \tanh ^{-1}(\cos (x))}{b^2}+\frac{\sqrt{a^2+b^2} \tanh ^{-1}\left (\frac{(b-a \cot (x)) \sin (x)}{\sqrt{a^2+b^2}}\right )}{b^2}-\frac{\csc (x)}{b}\\ \end{align*}
Mathematica [A] time = 0.123826, size = 67, normalized size = 1.26 \[ \frac{2 \sqrt{a^2+b^2} \tanh ^{-1}\left (\frac{b \tan \left (\frac{x}{2}\right )-a}{\sqrt{a^2+b^2}}\right )+a \left (\log \left (\cos \left (\frac{x}{2}\right )\right )-\log \left (\sin \left (\frac{x}{2}\right )\right )\right )-b \csc (x)}{b^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.07, size = 107, normalized size = 2. \begin{align*} -{\frac{1}{2\,b}\tan \left ({\frac{x}{2}} \right ) }+2\,{\frac{{a}^{2}}{\sqrt{{a}^{2}+{b}^{2}}{b}^{2}}{\it Artanh} \left ( 1/2\,{\frac{2\,\tan \left ( x/2 \right ) b-2\,a}{\sqrt{{a}^{2}+{b}^{2}}}} \right ) }+2\,{\frac{1}{\sqrt{{a}^{2}+{b}^{2}}}{\it Artanh} \left ( 1/2\,{\frac{2\,\tan \left ( x/2 \right ) b-2\,a}{\sqrt{{a}^{2}+{b}^{2}}}} \right ) }-{\frac{1}{2\,b} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{-1}}-{\frac{a}{{b}^{2}}\ln \left ( \tan \left ({\frac{x}{2}} \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.98187, size = 370, normalized size = 6.98 \begin{align*} \frac{a \log \left (\frac{1}{2} \, \cos \left (x\right ) + \frac{1}{2}\right ) \sin \left (x\right ) - a \log \left (-\frac{1}{2} \, \cos \left (x\right ) + \frac{1}{2}\right ) \sin \left (x\right ) + \sqrt{a^{2} + b^{2}} \log \left (-\frac{2 \, a b \cos \left (x\right ) \sin \left (x\right ) -{\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} - a^{2} - 2 \, b^{2} + 2 \, \sqrt{a^{2} + b^{2}}{\left (a \cos \left (x\right ) - b \sin \left (x\right )\right )}}{2 \, a b \cos \left (x\right ) \sin \left (x\right ) -{\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + a^{2}}\right ) \sin \left (x\right ) - 2 \, b}{2 \, b^{2} \sin \left (x\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\csc ^{3}{\left (x \right )}}{a + b \cot{\left (x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.36496, size = 146, normalized size = 2.75 \begin{align*} -\frac{a \log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) \right |}\right )}{b^{2}} - \frac{\tan \left (\frac{1}{2} \, x\right )}{2 \, b} - \frac{\sqrt{a^{2} + b^{2}} \log \left (\frac{{\left | 2 \, b \tan \left (\frac{1}{2} \, x\right ) - 2 \, a - 2 \, \sqrt{a^{2} + b^{2}} \right |}}{{\left | 2 \, b \tan \left (\frac{1}{2} \, x\right ) - 2 \, a + 2 \, \sqrt{a^{2} + b^{2}} \right |}}\right )}{b^{2}} + \frac{2 \, a \tan \left (\frac{1}{2} \, x\right ) - b}{2 \, b^{2} \tan \left (\frac{1}{2} \, x\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]